import message from './message.vue'
import Vue from 'vue'

const MessageConstructor = Vue.extend(message);

const serve = (message)=>{
    let messageInstance = new MessageConstructor();

    messageInstance.$mount(document.createElement('div'))

    document.body.appendChild(messageInstance.$el)

    messageInstance.message=message;
    messageInstance.visible=true;
    Vue.nextTick(()=>{
        setTimeout(() => {
            messageInstance.visible=false
        }, 3000);
    })
}

    export default serve;